package com.zhike.b2b.company.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.StringTokenizer;

import com.formbean.BrandForm;
import com.saas.biz.commen.Charset;
import com.saas.biz.commen.CommGetId;
import com.saas.biz.commen.CommMethodMgr;
import com.saas.biz.commen.Thumbnail;
import com.saas.biz.paramMgr.ParamInfo;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
import com.zhike.b2b.dao.Dbtable;

public class BrandInfo
{
  Dbtable tradeQuery = new Dbtable();
  Logger log = new Logger(this);
  Buffers inBuffer;
  Buffers outBuffer;
  ArrayList queryResult = new ArrayList();
  CommMethodMgr commen = new CommMethodMgr();
  Charset charset = new Charset();

  public void setTradeQuery(Dbtable paramDbtable)
  {
    this.tradeQuery = paramDbtable;
  }

  public Dbtable getTradeQuery()
  {
    return this.tradeQuery;
  }

  public void setOutBuffer(Buffers paramBuffers)
  {
    this.outBuffer = paramBuffers;
  }

  public Buffers getOutBuffer()
  {
    return this.outBuffer;
  }

  public ArrayList getQueryResult()
  {
    return this.queryResult;
  }

  public void setQueryResult(ArrayList paramArrayList)
  {
    this.queryResult = paramArrayList;
  }

  public List pojoQuery_Select(BrandForm paramBrandForm, String paramString)
  {
    BrandExt be = new BrandExt();
    be.setParam(":VID", paramBrandForm.getId());
    be.setParam(":VBRAND_NAME", paramBrandForm.getBrand_name());
    be.setParam(":VCLASS_ID", paramBrandForm.getClass_id());
    be.setParam(":VBUSINESS_MODEL", paramBrandForm.getBusiness_model());
    be.setParam(":VBRAND_DESC", paramBrandForm.getBrand_desc());
    be.setParam(":VBRAND_AREA", paramBrandForm.getBrand_area());
    be.setParam(":VCOMPANY_URL", paramBrandForm.getCompany_url());
    be.setParam(":VLOGO", paramBrandForm.getLogo());
    be.setParam(":VCOMMEND", paramBrandForm.getCommend());
    be.setParam(":VVALIDITY", paramBrandForm.getValidity());
    be.setParam(":VCUST_ID", paramBrandForm.getCust_id());
    be.setParam(":VUSER_ID", paramBrandForm.getUser_id());
    be.setParam(":VADD_DATE", paramBrandForm.getAdd_date());
    be.setParam(":VOPER_TIME", paramBrandForm.getOper_time());
    be.setParam(":VCONTACT_NAME", paramBrandForm.getContact_name());
    be.setParam(":VSORT_NO", paramBrandForm.getSort_no());
    be.setParam(":VRECOMMEND_BRAND", paramBrandForm.getRecommend_brand());
    be.setParam(":VCLASS_NAME", paramBrandForm.getClass_name());
    be.setParam(":VCLASS_DESC", paramBrandForm.getClass_desc());
    be.setParam(":VCHECKED", paramBrandForm.getChecked());
    be.setParam(":VCHECK_USER", paramBrandForm.getCheck_user());
    be.setParam(":VCHECK_TIME", paramBrandForm.getCheck_time());
    be.setParam(":VOPER_USER", paramBrandForm.getOper_user());
    be.setParam(":VREMOVE_TAG", paramBrandForm.getRemove_tag());
    be.setParam(":VCLASS_ATTR", paramBrandForm.getClass_attr());
    be.setParam(":VLIST_MODEL", paramBrandForm.getList_model());
    be.setParam(":VINDEX_MODEL", paramBrandForm.getIndex_model());
    be.setParam(":VCONTENT_MODEL", paramBrandForm.getContent_model());
    be.setParam(":VSTORE_PATH", paramBrandForm.getStore_path());
    be.setParam(":VLIST_RULE", paramBrandForm.getList_rule());
    be.setParam(":VHOME_NAME", paramBrandForm.getHome_name());
    be.setParam(":VARTICLE_RULE", paramBrandForm.getArticle_rule());
    be.setParam(":VDYNA_SHOW", paramBrandForm.getDyna_show());
    be.setParam(":VREMARK", paramBrandForm.getRemark());
    return be.selByList(paramString);
  }

  public void pojoQuery_InUP(BrandForm paramBrandForm, String paramString)
    throws SaasApplicationException
  {
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VID", paramBrandForm.getId());
    localBrandExt.setParam(":VBRAND_NAME", paramBrandForm.getBrand_name());
    localBrandExt.setParam(":VCLASS_ID", paramBrandForm.getClass_id());
    localBrandExt.setParam(":VBUSINESS_MODEL", paramBrandForm.getBusiness_model());
    localBrandExt.setParam(":VBRAND_DESC", paramBrandForm.getBrand_desc());
    localBrandExt.setParam(":VBRAND_AREA", paramBrandForm.getBrand_area());
    localBrandExt.setParam(":VCOMPANY_URL", paramBrandForm.getCompany_url());
    localBrandExt.setParam(":VLOGO", paramBrandForm.getLogo());
    localBrandExt.setParam(":VCOMMEND", paramBrandForm.getCommend());
    localBrandExt.setParam(":VVALIDITY", paramBrandForm.getValidity());
    localBrandExt.setParam(":VCUST_ID", paramBrandForm.getCust_id());
    localBrandExt.setParam(":VUSER_ID", paramBrandForm.getUser_id());
    localBrandExt.setParam(":VADD_DATE", paramBrandForm.getAdd_date());
    localBrandExt.setParam(":VOPER_TIME", paramBrandForm.getOper_time());
    localBrandExt.setParam(":VCONTACT_NAME", paramBrandForm.getContact_name());
    localBrandExt.setParam(":VSORT_NO", paramBrandForm.getSort_no());
    localBrandExt.setParam(":VRECOMMEND_BRAND", paramBrandForm.getRecommend_brand());
    localBrandExt.setParam(":VCLASS_NAME", paramBrandForm.getClass_name());
    localBrandExt.setParam(":VCLASS_DESC", paramBrandForm.getClass_desc());
    localBrandExt.setParam(":VCHECKED", paramBrandForm.getChecked());
    localBrandExt.setParam(":VCHECK_USER", paramBrandForm.getCheck_user());
    localBrandExt.setParam(":VCHECK_TIME", paramBrandForm.getCheck_time());
    localBrandExt.setParam(":VOPER_USER", paramBrandForm.getOper_user());
    localBrandExt.setParam(":VREMOVE_TAG", paramBrandForm.getRemove_tag());
    localBrandExt.setParam(":VCLASS_ATTR", paramBrandForm.getClass_attr());
    localBrandExt.setParam(":VLIST_MODEL", paramBrandForm.getList_model());
    localBrandExt.setParam(":VINDEX_MODEL", paramBrandForm.getIndex_model());
    localBrandExt.setParam(":VCONTENT_MODEL", paramBrandForm.getContent_model());
    localBrandExt.setParam(":VSTORE_PATH", paramBrandForm.getStore_path());
    localBrandExt.setParam(":VLIST_RULE", paramBrandForm.getList_rule());
    localBrandExt.setParam(":VHOME_NAME", paramBrandForm.getHome_name());
    localBrandExt.setParam(":VARTICLE_RULE", paramBrandForm.getArticle_rule());
    localBrandExt.setParam(":VDYNA_SHOW", paramBrandForm.getDyna_show());
    localBrandExt.setParam(":VREMARK", paramBrandForm.getRemark());
    localBrandExt.setParam(":VPPZSJMHZTJLC", paramBrandForm.getPpzsjmhztjlc());
    String str1 = paramBrandForm.getId();
    String str2 = getloGo(str1);
    String str3 = paramBrandForm.getLogo();
    if ((!str3.equals(str2)) && (str3 != null) && (!str3.equals("")))
      new Thumbnail().creatThumbnail("brand", str3);
    this.tradeQuery.executeBy(localBrandExt.insBy(paramString));
  }

  private String getloGo(String paramString)
  {
    String str1 = "";
    String str2 = "select logo from brand where id=" + paramString;
   
    return str1;
  }

  public BrandForm initBrandForm(Buffers paramBuffers)
  {
    BrandForm localBrandForm = new BrandForm();
    localBrandForm.id = paramBuffers.getString("ID");
    localBrandForm.brand_name = paramBuffers.getString("BRAND_NAME");
    localBrandForm.class_id = paramBuffers.getString("CLASS_ID");
    localBrandForm.business_model = paramBuffers.getString("BUSINESS_MODEL");
    localBrandForm.brand_desc = paramBuffers.getString("BRAND_DESC");
    localBrandForm.brand_area = paramBuffers.getString("BRAND_AREA");
    localBrandForm.company_url = paramBuffers.getString("COMPANY_URL");
    localBrandForm.logo = paramBuffers.getString("LOGO");
    localBrandForm.commend = (paramBuffers.getString("COMMEND").equals("") ? "0" : paramBuffers.getString("COMMEND"));
    localBrandForm.validity = (paramBuffers.getString("VALIDITY").equals("") ? "0" : paramBuffers.getString("VALIDITY"));
    localBrandForm.cust_id = paramBuffers.getString("CUST_ID");
    localBrandForm.user_id = paramBuffers.getString("USER_ID");
    localBrandForm.add_date = paramBuffers.getString("ADD_DATE");
    localBrandForm.oper_time = paramBuffers.getString("OPER_TIME");
    localBrandForm.contact_name = paramBuffers.getString("CONTACT_NAME");
    localBrandForm.sort_no = (paramBuffers.getString("SORT_NO").equals("") ? "0" : paramBuffers.getString("SORT_NO"));
    localBrandForm.recommend_brand = (paramBuffers.getString("RECOMMEND_BRAN").equals("") ? "0" : paramBuffers.getString("RECOMMEND_BRAN"));
    localBrandForm.class_name = paramBuffers.getString("CLASS_NAME");
    localBrandForm.class_desc = paramBuffers.getString("CLASS_DESC");
    localBrandForm.checked = paramBuffers.getString("CHECKED");
    localBrandForm.check_user = paramBuffers.getString("CHECK_USER");
    localBrandForm.check_time = paramBuffers.getString("CHECK_TIME");
    localBrandForm.oper_user = paramBuffers.getString("OPER_USER");
    localBrandForm.remove_tag = paramBuffers.getString("REMOVE_TAG");
    localBrandForm.class_attr = paramBuffers.getString("CLASS_ATTR");
    localBrandForm.list_model = paramBuffers.getString("LIST_MODEL");
    localBrandForm.index_model = paramBuffers.getString("INDEX_MODEL");
    localBrandForm.content_model = paramBuffers.getString("CONTENT_MODEL");
    localBrandForm.store_path = paramBuffers.getString("STORE_PATH");
    localBrandForm.list_rule = paramBuffers.getString("LIST_RULE");
    localBrandForm.home_name = paramBuffers.getString("HOME_NAME");
    localBrandForm.article_rule = paramBuffers.getString("ARTICLE_RULE");
    localBrandForm.dyna_show = paramBuffers.getString("DYNA_SHOW");
    localBrandForm.remark = paramBuffers.getString("REMARK");
    localBrandForm.ppzsjmhztjlc = paramBuffers.getString("ppzsjmhztjlc");
    return localBrandForm;
  }

  public String getPathByClass_Id(String paramString)
  {
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCLASS_ID", paramString);
    List localArrayList = localBrandExt.selByList("QUERY_STORE_PATH_BY_CLASSID");
    if ((localArrayList != null) && (localArrayList.size() > 0))
    {
      HashMap localHashMap = (HashMap)localArrayList.get(0);
      return localHashMap.get("store_path") == null ? "" : localHashMap.get("store_path").toString();
    }
    return "";
  }

  public void addBrand(Buffers paramBuffers)
    throws SaasApplicationException
  {
    this.log.LOG_INFO("进入addBrand方法...");
    paramBuffers.setClassName("BrandQuery");
    this.outBuffer = paramBuffers;
    this.inBuffer = paramBuffers;
    CommGetId localcommGetId = new CommGetId();
    BrandForm localBrandForm = initBrandForm(paramBuffers);
    StringTokenizer localStringTokenizer = new StringTokenizer(paramBuffers.getString("class_id"), "|");
    for (String str = localcommGetId.getTradeId(localcommGetId.getTradeIdNoHandle("brand", "id")); localStringTokenizer.hasMoreTokens(); str = localcommGetId.getTradeId(str))
    {
      localBrandForm.setId(str);
      localBrandForm.setClass_id(localStringTokenizer.nextToken());
      pojoQuery_InUP(localBrandForm, "INSERT_INTO_BRAND");
    }
  }

  public List selectBrandCheck(String paramString1, String paramString2, int paramInt1, int paramInt2)
    throws SaasApplicationException
  {
    this.log.LOG_INFO("进入selectBrand方法...");
    if (paramInt1 > 0)
      paramInt1 = (paramInt1 - 1) * paramInt2;
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VBRAND_NAME", "%" + paramString1 + "%");
    localBrandExt.setParam(":VCLASS_ID", paramString2 + "%");
    return localBrandExt.selByList("SELECT_BRAND_ADMIN_CHECK", paramInt1, paramInt2);
  }

  public int selectBrandCountCheck(String paramString1, String paramString2)
    throws SaasApplicationException
  {
    this.log.LOG_INFO("进入selectBrandCount方法...");
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VBRAND_NAME", "%" + paramString1 + "%");
    localBrandExt.setParam(":VCLASS_ID", paramString2 + "%");
    List localArrayList = localBrandExt.selByList("SELECT_BRAND_COUNT_ADMIN_CHECK");
    if ((localArrayList != null) && (localArrayList.size() > 0))
      return localArrayList.size();
    return 0;
  }

  public List selectBrand_ListCheck(String paramString1, String paramString2)
    throws SaasApplicationException
  {
    this.log.LOG_INFO("进入selectBrand方法...");
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VBRAND_NAME", paramString1);
    localBrandExt.setParam(":VCLASS_ID", paramString2 + "%");
    return localBrandExt.selByList("SELECT_BRAND_LIST_ADMIN_CHECK");
  }

  public void downBrandById(String paramString)
    throws SaasApplicationException
  {
      String sql = "update brand set validity = 7 where id = " + paramString;
  }

  public void checkById(String paramString1, String paramString2)
    throws SaasApplicationException
  {
	  String sql = "update brand set validity=" + paramString1 + " where id=" + paramString2;
  }

  public List selectBrand(String paramString1, String paramString2, String paramString3, int paramInt1, int paramInt2)
    throws SaasApplicationException
  {
    ParamInfo localParamInfo = new ParamInfo();
    String str = localParamInfo.getParameter("pass_show");
    this.log.LOG_INFO("进入selectBrand方法...");
    if (paramInt1 > 0)
      paramInt1 = (paramInt1 - 1) * paramInt2;
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VBRAND_NAME", "%" + paramString1 + "%");
    localBrandExt.setParam(":VCLASS_ID", paramString2 + "%");
    if ("0".equals(str))
      return localBrandExt.selByList("SELECT_BRAND_ADMIN_0", paramInt1, paramInt2);
    return localBrandExt.selByList("SELECT_BRAND_ADMIN_1", paramInt1, paramInt2);
  }

  public int selectBrandCount(String paramString1, String paramString2, String paramString3)
    throws SaasApplicationException
  {
    ParamInfo localParamInfo = new ParamInfo();
    String str = localParamInfo.getParameter("pass_show");
    this.log.LOG_INFO("进入selectBrandCount方法...");
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VBRAND_NAME", "%" + paramString1 + "%");
    localBrandExt.setParam(":VCLASS_ID", paramString2 + "%");
    List data = null;
    if ("0".equals(str))
    	data = localBrandExt.selByList("SELECT_BRAND_COUNT_ADMIN_0");
    else
    	data = localBrandExt.selByList("SELECT_BRAND_COUNT_ADMIN_1");
    if ((data != null) && (data.size() > 0))
      return data.size();
    return 0;
  }

  public String getAllClassSelectForAdd(String paramString)
  {
    List localArrayList = getAllClassListForAdd(paramString);
    String str1 = "";
    String str2 = "";
    String str3 = "";
    if (localArrayList != null)
    {
      str3 = "<option value='selected'>--请选择--</option>";
      for (int i = 0; i < localArrayList.size(); i++)
      {
        HashMap localHashMap = (HashMap)localArrayList.get(i);
        if (localHashMap.get("class_name") != null)
          str1 = localHashMap.get("class_name").toString();
        if (localHashMap.get("class_id") != null)
          str2 = localHashMap.get("class_id").toString();
        str3 = str3 + "<option value=" + str2 + ">" + str1 + "</option>";
      }
    }
    return str3;
  }

  public List selectBrand_member(String paramString1, String paramString2, String paramString3, int paramInt1, int paramInt2)
    throws SaasApplicationException
  {
    this.log.LOG_INFO("进入selectBrand方法...");
    if (paramInt1 > 0)
      paramInt1 = (paramInt1 - 1) * paramInt2;
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VBRAND_NAME", "%" + paramString1 + "%");
    localBrandExt.setParam(":VCLASS_ID", paramString2 + "%");
    localBrandExt.setParam(":VCUST_ID", paramString3);
    return localBrandExt.selByList("SELECT_BRAND", paramInt1, paramInt2);
  }

  public int selectBrandCount_member(String paramString1, String paramString2, String paramString3)
    throws SaasApplicationException
  {
    this.log.LOG_INFO("进入selectBrandCount方法...");
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VBRAND_NAME", "%" + paramString1 + "%");
    localBrandExt.setParam(":VCLASS_ID", paramString2 + "%");
    localBrandExt.setParam(":VCUST_ID", paramString3);
    List data = localBrandExt.selByList("SELECT_BRAND_COUNT");
    if ((data != null) && (data.size() > 0))
      return data.size();
    return 0;
  }

  public List selectBrand_List(String paramString1, String paramString2, String paramString3)
    throws SaasApplicationException
  {
    this.log.LOG_INFO("进入selectBrand方法...");
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VBRAND_NAME", paramString1);
    localBrandExt.setParam(":VCLASS_ID", paramString2 + "%");
    localBrandExt.setParam(":VCUST_ID", paramString3);
    return localBrandExt.selByList("SELECT_BRAND_LIST");
  }

  public List selectBrand_List(String paramString1, String paramString2)
    throws SaasApplicationException
  {
    ParamInfo localParamInfo = new ParamInfo();
    String str = localParamInfo.getParameter("pass_show");
    this.log.LOG_INFO("进入selectBrand方法...");
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VBRAND_NAME", paramString1);
    localBrandExt.setParam(":VCLASS_ID", paramString2 + "%");
    if ("1".equals(str))
      return localBrandExt.selByList("SELECT_BRAND_LIST_ADMIN_1");
    return localBrandExt.selByList("SELECT_BRAND_LIST_ADMIN_0");
  }

  public List getBrandByClassId(String paramString)
    throws SaasApplicationException
  {
    this.log.LOG_INFO("进入selectBrand方法...");
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCLASS_ID", paramString + "%");
    return localBrandExt.selByList("SELECT_BRAND_BY_CLASSID");
  }

  public List selectCustPage(String paramString, int paramInt1, int paramInt2)
  {
    this.log.LOG_INFO("进入selectBrand方法...");
    if (paramInt1 > 0)
      paramInt1 = (paramInt1 - 1) * paramInt2;
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCUST_NAME", "%" + paramString + "%");
    return localBrandExt.selByList("SELECT_BRAND_CUST_ID", paramInt1, paramInt2);
  }

  public int selectCustPage(String paramString)
  {
    this.log.LOG_INFO("进入selectCustPage方法...");
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCUST_NAME", "%" + paramString + "%");
    List localArrayList = localBrandExt.selByList("SELECT_BRAND_CUST_ID_COUNT");
    if ((localArrayList != null) && (localArrayList.size() > 0))
      return localArrayList.size();
    return 0;
  }

  public void updateBrandById(Buffers paramBuffers)
    throws SaasApplicationException
  {
    this.log.LOG_INFO("进入updateBrandById方法...");
    paramBuffers.setClassName("BrandQuery");
    this.outBuffer = paramBuffers;
    this.inBuffer = paramBuffers;
    CommGetId localcommGetId = new CommGetId();
    BrandForm localBrandForm = initBrandForm(paramBuffers);
    StringTokenizer localStringTokenizer = new StringTokenizer(paramBuffers.getString("class_id"), "|");
    for (String str = localcommGetId.getTradeId(localcommGetId.getTradeIdNoHandle("brand", "id")); localStringTokenizer.hasMoreTokens(); str = localcommGetId.getTradeId(str))
    {
      localBrandForm.setClass_id(localStringTokenizer.nextToken());
      pojoQuery_InUP(localBrandForm, "UPDATE_BRAND_BY_ID");
    }
  }

  public List getBrandClassId(String paramString)
    throws SaasApplicationException
  {
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCLASS_ID", paramString + "%");
    List data = localBrandExt.selByList("SEL_BY_PRODUCTNAME");
    return data;
  }

  public void deleteBrandById(String paramString)
    throws SaasApplicationException
  {
    String sql = "delete from brand where id =" + paramString;
  }

  public void checkBrandById(String paramString1, String paramString2)
    throws SaasApplicationException
  {
    String sql = "update brand set validity=" + paramString1 + " where id=" + paramString2;
  }

  public void commendBrandById(String paramString1, String paramString2)
    throws SaasApplicationException
  {
	  String sql = "update brand set commend=" + paramString1 + " where id=" + paramString2;
  }

  public void refreshBrandById(String paramString)
    throws SaasApplicationException
  {
    String str = "update brand set oper_time=now() where id=" + paramString;
    System.out.print(str);
    String sql = "update brand set oper_time=now() where id=" + paramString;
  }

  public List getRecommendBrand()
    throws SaasApplicationException
  {
	String sql = "select distinct b.brand_name,bc.class_name,concat(bc.store_path,replace(replace(bc.article_rule,'{class_id}',bc.class_id),'{fid}',b.id)) as news_url,concat(bc.store_path,replace(replace(bc.list_rule,'{class_id}',bc.class_id),'{pageindex}',1)) as class_url from brand b left join brand_class bc on b.class_id = bc.class_id and bc.class_name in (select class_name from brand_class order by class_name )where b.commend ='1' order by class_name ";
    return null;
  }

  public int selectSiteParam(String paramString)
    throws SaasApplicationException
  {
    this.log.LOG_INFO("进入selectBrandById方法...");
    BrandExt localBrandExt = new BrandExt();
    List data = localBrandExt.selByList("SPARAM");
    if ((data != null) && (data.size() > 0))
      return 1;
    return 0;
  }

  public List selectBrandById(String paramString)
    throws SaasApplicationException
  {
    this.log.LOG_INFO("进入selectBrandById方法...");
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VID", paramString);
    return localBrandExt.selByList("SELECT_BRAND_BY_ID");
  }

  public List getSecondClass_Id(String paramString)
  {
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VLENGTH", paramString);
    List localArrayList = localBrandExt.selByList("SEL_SECOND_CLASS");
    return localArrayList;
  }

  public List getArea_BY_Id(String paramString)
  {
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VAREA_ID", paramString);
    List localArrayList = localBrandExt.selByList("SEL_AREA_BY_ID");
    return localArrayList;
  }

  public List getChildrenClass(String paramString1, String paramString2)
    throws SaasApplicationException
  {
    String str = "10";
    if (paramString1.length() == 3)
      str = "6";
    else if (paramString1.length() == 6)
      str = "10";
    else if (paramString1.length() == 10)
      str = "15";
    else if (paramString1.length() == 15)
      str = "20";
    else if (paramString1.length() == 20)
      return null;
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCLASS_ID", paramString1 + "%");
    localBrandExt.setParam(":VTABLENAME", paramString2);
    localBrandExt.setParam(":VlENGTH", str);
    List data = localBrandExt.selByList("SEL_BY_SUN_CLASSID");
    return data;
  }

  public List getChildrenClass(String paramString1, String paramString2, String paramString3)
    throws SaasApplicationException
  {
    String str = "10";
    if (paramString1.length() == 3)
      str = "6";
    else if (paramString1.length() == 6)
      str = "10";
    else if (paramString1.length() == 10)
      str = "15";
    else if (paramString1.length() == 15)
      str = "20";
    else if (paramString1.length() == 20)
      return null;
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCLASS_ID", paramString1 + "%");
    localBrandExt.setParam(":VTABLENAME", paramString2);
    localBrandExt.setParam(":VlENGTH", str);
    localBrandExt.setParam(":VBRAND_NAME", paramString3);
    List data = localBrandExt.selByList("SEL_BY_SUN_CLASSID_BRAND_NAME");
    return data;
  }

  public void addBrandClass(Buffers paramBuffers)
    throws SaasApplicationException
  {
    this.log.LOG_INFO("进入addBrandClass方法...");
    paramBuffers.setClassName("BrandQuery");
    this.outBuffer = paramBuffers;
    this.inBuffer = paramBuffers;
    BrandExt localBrandExt = new BrandExt();
    BrandForm localBrandForm = new BrandForm();
    String str1 = paramBuffers.getString("CLASS_ID");
    CommGetId localcommGetId = new CommGetId();
    String str2 = getMaxId(str1);
    String str3 = localcommGetId.getId(str1, str2);
    localBrandForm.setClass_id(str3);
    localBrandForm.setClass_name(paramBuffers.getString("CLASS_NAME"));
    localBrandForm.setClass_desc(paramBuffers.getString("CLASS_DESC"));
    localBrandForm.setRemove_tag(paramBuffers.getString("REMOVE_TAG"));
    localBrandForm.setOper_user(paramBuffers.getString("SESSION_USER_ID"));
    localBrandForm.setList_model(paramBuffers.getString("LIST_MODEL"));
    localBrandForm.setIndex_model(paramBuffers.getString("INDEX_MODEL"));
    localBrandForm.setContent_model(paramBuffers.getString("CONTENT_MODEL"));
    localBrandForm.setStore_path(paramBuffers.getString("STORE_PATH"));
    localBrandForm.setList_rule(paramBuffers.getString("LIST_RULE"));
    localBrandForm.setHome_name(paramBuffers.getString("HOME_NAME"));
    localBrandForm.setArticle_rule(paramBuffers.getString("ARTICLE_RULE"));
    localBrandForm.setDyna_show(paramBuffers.getString("DYNA_SHOW"));
    localBrandExt.setParam(":VCLASS_ID", localBrandForm.getClass_id());
    localBrandExt.setParam(":VCLASS_NAME", localBrandForm.getClass_name());
    localBrandExt.setParam(":VREMOVE_TAG", localBrandForm.getRemove_tag());
    localBrandExt.setParam(":VOPER_USER", localBrandForm.getOper_user());
    localBrandExt.setParam(":VSTOCE_PATH", localBrandForm.getStore_path());
    localBrandExt.setParam(":VSESSION_USER_ID", localBrandForm.getStore_path());
    localBrandExt.setParam(":VHOME_NAME", localBrandForm.getHome_name());
    localBrandExt.setParam(":VINDEX_MODEL", localBrandForm.getIndex_model());
    localBrandExt.setParam(":VLIST_MODEL", localBrandForm.getList_model());
    localBrandExt.setParam(":VCONTENT_MODEL", localBrandForm.getContent_model());
    localBrandExt.setParam(":VARTICLE_RULE", localBrandForm.getArticle_rule());
    localBrandExt.setParam(":VLIST_RULE", localBrandForm.getList_rule());
    localBrandExt.setParam(":VDYNA_SHOW", localBrandForm.getDyna_show());
    localBrandExt.setParam(":VCLASS_DESC", localBrandForm.getClass_desc());
    this.tradeQuery.executeBy(localBrandExt.insBy("ADD_BRAND_CLASS"));
  }

  public String getMaxId(String paramString)
    throws SaasApplicationException
  {
    String str = "";
    BrandExt localBrandExt = new BrandExt();
    int i = paramString.length();
    List localArrayList = null;
    int j = 0;
    if (i == 0)
      j = 3;
    else if (i == 3)
      j = 6;
    else if (i == 6)
      j = 10;
    else if (i == 10)
      j = 15;
    else if (i == 15)
      j = 20;
    if (i == 0)
    {
      localArrayList = localBrandExt.selByList("SEL_ONE_BY_NONE");
    }
    else
    {
      localBrandExt.setParam(":VLENGTH", Integer.valueOf(j));
      localBrandExt.setParam(":VUP_ID", paramString + "%");
      localArrayList = localBrandExt.selByList("SELECT_MAXID");
    }
    if ((localArrayList != null) && (localArrayList.size() > 0))
    {
      HashMap localHashMap = (HashMap)localArrayList.get(0);
      if (localHashMap.get("maxid") != null)
        str = localHashMap.get("maxid").toString();
    }
    return str;
  }

  public List getAllClassList(int paramInt1, int paramInt2, String paramString)
  {
    if (paramInt1 == 0)
      paramInt1 = 0;
    else
      paramInt1 = (paramInt1 - 1) * paramInt2;
    List localArrayList = null;
    BrandExt localBrandExt = new BrandExt();
    int i = paramString.length();
    int j = 0;
    if (i == 0)
      j = 3;
    else if (i == 3)
      j = 6;
    else if (i == 6)
      j = 10;
    else if (i == 10)
      j = 15;
    else if (i == 15)
      j = 20;
    if (i == 0)
    {
      localArrayList = localBrandExt.selByList("SEL_ALL_ONE_BY_NONE", paramInt1, paramInt2);
    }
    else
    {
      localBrandExt.setParam(":VLENGTH", Integer.valueOf(j));
      localBrandExt.setParam(":VUP_ID", paramString + "%");
      localArrayList = localBrandExt.selByList("SELECT_SON_BY_UP", paramInt1, paramInt2);
    }
    return localArrayList;
  }

  public int getAllClassList(String paramString)
  {
    List localArrayList = null;
    BrandExt localBrandExt = new BrandExt();
    int i = paramString.length();
    int j = 0;
    if (i == 0)
      j = 3;
    else if (i == 3)
      j = 6;
    else if (i == 6)
      j = 10;
    else if (i == 10)
      j = 15;
    else if (i == 15)
      j = 20;
    if (i == 0)
    {
      localArrayList = localBrandExt.selByList("SEL_ALL_ONE_BY_NONE");
    }
    else
    {
      localBrandExt.setParam(":VLENGTH", Integer.valueOf(j));
      localBrandExt.setParam(":VUP_ID", paramString + "%");
      localArrayList = localBrandExt.selByList("SELECT_SON_BY_UP");
    }
    if ((localArrayList != null) && (localArrayList.size() > 0))
      return localArrayList.size();
    return 0;
  }

  public String getClassNameById(String paramString)
    throws SaasApplicationException
  {
    List localArrayList = null;
    String str = "";
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCLASS_ID", paramString);
    localArrayList = localBrandExt.selByList("SEL_BY_CLASSID");
    if ((localArrayList != null) && (localArrayList.size() > 0))
    {
      HashMap localHashMap = (HashMap)localArrayList.get(0);
      if (localHashMap.get("class_name") != null)
        str = localHashMap.get("class_name").toString();
    }
    return str;
  }

  public List getClsById(String paramString)
    throws SaasApplicationException
  {
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCLASS_ID", paramString);
    List data = localBrandExt.selByList("SEL_BY_CLASSID");
    if ((null != data) && (data.size() > 0))
      return data;
    return null;
  }

  public void updateClassInfo(Buffers paramBuffers)
  {
    this.log.LOG_INFO("进入addClassInfo方法...");
    paramBuffers.setClassName("BrandQuery");
    this.outBuffer = paramBuffers;
    this.inBuffer = paramBuffers;
    int i = -1;
    try
    {
      BrandForm localBrandForm = new BrandForm();
      localBrandForm.setClass_id(paramBuffers.getString("CLASS_ID"));
      localBrandForm.setClass_name(paramBuffers.getString("CLASS_NAME"));
      localBrandForm.setClass_desc(paramBuffers.getString("CLASS_DESC"));
      localBrandForm.setRemove_tag(paramBuffers.getString("REMOVE_TAG"));
      localBrandForm.setOper_user(paramBuffers.getString("SESSION_USER_ID"));
      localBrandForm.setList_model(paramBuffers.getString("LIST_MODEL"));
      localBrandForm.setIndex_model(paramBuffers.getString("INDEX_MODEL"));
      localBrandForm.setContent_model(paramBuffers.getString("CONTENT_MODEL"));
      localBrandForm.setStore_path(paramBuffers.getString("STORE_PATH"));
      localBrandForm.setList_rule(paramBuffers.getString("LIST_RULE"));
      localBrandForm.setHome_name(paramBuffers.getString("HOME_NAME"));
      localBrandForm.setArticle_rule(paramBuffers.getString("ARTICLE_RULE"));
      localBrandForm.setDyna_show(paramBuffers.getString("DYNA_SHOW"));
      i = updateClassInfo(localBrandForm);
    }
    catch (SaasApplicationException localSaasApplicationException)
    {
      this.log.LOG_INFO(localSaasApplicationException.getMessage());
    }
    if (i != 0)
    {
      this.outBuffer.setInt("RESULT_CODE", -1);
      this.outBuffer.setString("RESULT_INFO", "业务处理失败！");
    }
    else
    {
      this.outBuffer.setInt("RESULT_CODE", 0);
      this.outBuffer.setString("RESULT_INFO", "业务处理成功！");
    }
    this.log.LOG_INFO("退出addClassInfo方法...");
  }

  public int updateClassInfo(BrandForm paramBrandForm)
    throws SaasApplicationException
  {
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCLASS_ID", paramBrandForm.getClass_id());
    localBrandExt.setParam(":VCLASS_NAME", paramBrandForm.getClass_name());
    localBrandExt.setParam(":VCLASS_DESC", paramBrandForm.getClass_desc());
    localBrandExt.setParam(":VREMOVE_TAG", paramBrandForm.getRemove_tag());
    localBrandExt.setParam(":VOPER_USER", paramBrandForm.getOper_user());
    localBrandExt.setParam(":VLIST_MODEL", paramBrandForm.getList_model());
    localBrandExt.setParam(":VINDEX_MODEL", paramBrandForm.getIndex_model());
    localBrandExt.setParam(":VCONTENT_MODEL", paramBrandForm.getContent_model());
    localBrandExt.setParam(":VSTOCE_PATH", paramBrandForm.getStore_path());
    localBrandExt.setParam(":VLIST_RULE", paramBrandForm.getList_rule());
    localBrandExt.setParam(":VHOME_NAME", paramBrandForm.getHome_name());
    localBrandExt.setParam(":VARTICLE_RULE", paramBrandForm.getArticle_rule());
    localBrandExt.setParam(":VDYNA_SHOW", paramBrandForm.getDyna_show());
    this.tradeQuery.executeBy(localBrandExt.insBy("UPDATE_BY_ALL_SALES_CLASS"));
    this.tradeQuery.executeBy(localBrandExt.insBy("UPDATE_SALES_CLASS_NAME_BY_CLASS_ID"));
    return 0;
  }

  public void delByClassId(Buffers paramBuffers)
  {
    paramBuffers.setClassName("BrandQuery");
    this.log.LOG_INFO("进入delByClassId方法...");
    this.outBuffer = paramBuffers;
    this.inBuffer = paramBuffers;
    int i = -1;
    String str1 = paramBuffers.getString("CLASS_ID");
    try
    {
      StringTokenizer localStringTokenizer = new StringTokenizer(str1, "|");
      String str2 = "";
      while (localStringTokenizer.hasMoreTokens())
      {
        str2 = localStringTokenizer.nextToken();
        List allClzs = getAllClassListForAdd(str2);
        List saleClzs = getSalesByClass(str2);
        int j = 0;
        if ((allClzs != null) && (allClzs.size() > 0))
          j++;
        if ((saleClzs != null) && (saleClzs.size() > 0))
          j++;
        if (j > 0)
        {
          i = 0;
          continue;
        }
        i = delByClassId(str2);
      }
    }
    catch (SaasApplicationException localSaasApplicationException)
    {
      this.log.LOG_INFO(localSaasApplicationException.getMessage());
    }
    if (i != 0)
    {
      this.outBuffer.setInt("RESULT_CODE", -1);
      this.outBuffer.setString("RESULT_INFO", "业务处理失败！");
    }
    else
    {
      this.outBuffer.setInt("RESULT_CODE", 0);
      this.outBuffer.setString("RESULT_INFO", "业务处理成功！");
    }
    this.log.LOG_INFO("退出delByClassId方法...");
  }

  public int delByClassId(String paramString)
    throws SaasApplicationException
  {
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCLASS_ID", paramString);
    this.tradeQuery.executeBy(localBrandExt.insBy("DELETE_BY_ALL_PRODUCT_CLASS"));
    return 0;
  }

  public List getAllClassListForAdd(String paramString)
  {
    List localArrayList = null;
    BrandExt localBrandExt = new BrandExt();
    int i = paramString.length();
    int j = 0;
    if (i == 0)
      j = 3;
    else if (i == 3)
      j = 6;
    else if (i == 6)
      j = 10;
    else if (i == 10)
      j = 15;
    else if (i == 15)
      j = 20;
    if (i == 0)
    {
      localArrayList = localBrandExt.selByList("SEL_ALL_ONE_BY_NONE");
    }
    else
    {
      localBrandExt.setParam(":VLENGTH", Integer.valueOf(j));
      localBrandExt.setParam(":VUP_ID", paramString + "%");
      localArrayList = localBrandExt.selByList("SELECT_SON_BY_UP");
    }
    return localArrayList;
  }

  public List getSalesByClass(String paramString)
  {
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCLASS_ID", paramString);
    List data = localBrandExt.selByList("SELECT_SALES_BY_CLASS_ID");
    return data;
  }

  public List getCompany(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, int paramInt1, int paramInt2)
  {
    this.log.LOG_INFO("进入getCompany方法...");
    if (paramInt1 > 0)
      paramInt1 = (paramInt1 - 1) * paramInt2;
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VTYPE", "%" + paramString1 + "%");
    localBrandExt.setParam(":VCUST_NAME", "%" + paramString2 + "%");
    localBrandExt.setParam(":VAREA_ID", paramString3 + "%");
    localBrandExt.setParam(":VCLASS_ID", "%" + paramString4 + "%");
    localBrandExt.setParam(":VSTART_DATE", paramString5);
    localBrandExt.setParam(":VEND_DATE", paramString6);
    return localBrandExt.selByList("SELECT_COMPANY_LIST_ALL", paramInt1, paramInt2);
  }

  public List getCompanyTuiJIan()
  {
    this.log.LOG_INFO("进入getCompany方法...");
    BrandExt localBrandExt = new BrandExt();
    return localBrandExt.selByList("SELECT_TUIJIAN_COMPANY_LIST");
  }

  public int getCompanyCount(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6)
  {
    this.log.LOG_INFO("进入getCompanyCount方法...");
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCUST_NAME", "%" + paramString2 + "%");
    localBrandExt.setParam(":VAREA_ID", paramString3 + "%");
    localBrandExt.setParam(":VCLASS_ID", "%" + paramString4 + "%");
    localBrandExt.setParam(":VSTART_DATE", paramString5);
    localBrandExt.setParam(":VEND_DATE", paramString6);
    localBrandExt.setParam(":VTYPE", "%" + paramString1 + "%");
    List data = localBrandExt.selByList("SELECT_COMPANY_LIST_COUNT_ALL");
    int i = 0;
    if ((data != null) && (data.size() > 0))
      i = data.size();
    return i;
  }

  public List getRecommendCompany(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, int paramInt1, int paramInt2)
  {
    this.log.LOG_INFO("进入getRecommendCompany方法...");
    if (paramInt1 > 0)
      paramInt1 = (paramInt1 - 1) * paramInt2;
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VTYPE", "%" + paramString1 + "%");
    localBrandExt.setParam(":VCUST_NAME", "%" + paramString2 + "%");
    localBrandExt.setParam(":VAREA_ID", paramString3 + "%");
    localBrandExt.setParam(":VCLASS_ID", "%" + paramString4 + "%");
    localBrandExt.setParam(":VSTART_DATE", paramString5);
    localBrandExt.setParam(":VEND_DATE", paramString6);
    localBrandExt.setParam(":VCOMMEND", "1");
    return localBrandExt.selByList("SELECT_COMPANY_LIST", paramInt1, paramInt2);
  }

  public int getRecommendCompanyCount(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6)
  {
    this.log.LOG_INFO("进入getCompanyCount方法...");
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCUST_NAME", "%" + paramString2 + "%");
    localBrandExt.setParam(":VAREA_ID", paramString3 + "%");
    localBrandExt.setParam(":VCLASS_ID", "%" + paramString4 + "%");
    localBrandExt.setParam(":VSTART_DATE", paramString5);
    localBrandExt.setParam(":VEND_DATE", paramString6);
    localBrandExt.setParam(":VCOMMEND", "1");
    localBrandExt.setParam(":VTYPE", "%" + paramString1 + "%");
    List localArrayList = localBrandExt.selByList("SELECT_COMPANY_LIST");
    if ((localArrayList != null) && (localArrayList.size() > 0))
      return localArrayList.size();
    return 0;
  }

  public HashMap getCompanyClass()
  {
    this.log.LOG_INFO("进入getCompanyClass方法...");
    BrandExt localBrandExt = new BrandExt();
    HashMap localHashMap1 = new HashMap();
    List localArrayList = localBrandExt.selByList("SELECT_CLASS_IDNAME");
    if ((localArrayList != null) && (localArrayList.size() > 0))
      for (int i = 0; i < localArrayList.size(); i++)
      {
        HashMap localHashMap2 = (HashMap)localArrayList.get(i);
        localHashMap1.put(localHashMap2.get("class_id").toString(), localHashMap2.get("class_name").toString());
      }
    return localHashMap1;
  }

  public String getClassName(String paramString)
  {
    this.log.LOG_INFO("进入getClassName方法...");
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCLASS_ID", paramString);
    String str = "";
    List localArrayList = localBrandExt.selByList("SELECT_CLASS_LIST");
    if ((localArrayList != null) && (localArrayList.size() > 0))
      for (int i = 0; i < localArrayList.size(); i++)
      {
        HashMap localHashMap = (HashMap)localArrayList.get(i);
        if (i != localArrayList.size() - 1)
          str = localHashMap.get("class_name").toString() + " > ";
        else
          str = localHashMap.get("class_name").toString();
      }
    return str;
  }

  public List getClass_NameCompany(String paramString1, String paramString2)
  {
    this.log.LOG_INFO("进入getClass_NameCompany方法...");
    String str = "3";
    if (paramString1.length() == 3)
      str = "6";
    else if (paramString1.length() == 6)
      str = "10";
    else if (paramString1.length() == 10)
      str = "15";
    else if (paramString1.length() == 15)
      str = "20";
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VCLASS_ID", paramString1 + "%");
    localBrandExt.setParam(":VTYPE", "%" + paramString2 + "%");
    localBrandExt.setParam(":VLENGTH", str);
    return localBrandExt.selByList("SELECT_CLASS_SONCLASS");
  }

  public ArrayList getCompareCompany(String paramString)
  {
    StringTokenizer localStringTokenizer = new StringTokenizer(paramString, "|");
    String str1 = "";
    while (localStringTokenizer.hasMoreElements())
    {
      String str2 = localStringTokenizer.nextElement().toString();
      if (str1.equals(""))
        str1 = str1 + "  cust_id ='" + str2 + "'";
      else
        str1 = str1 + " or cust_id ='" + str2 + "'";
    }
    String sql = "select cust_id,enterprise_type_code,substr(add_date,1,10) add_date,user_count,cust_name,EPARCHY_CODE,website,company_SCOPE,level_name,CUST_SUPPLY,logo_img from company where " + str1;
    return null;
  }

  public List getCompareBrand(String paramString)
  {
    StringTokenizer localStringTokenizer = new StringTokenizer(paramString, "|");
    String str1 = "";
    while (localStringTokenizer.hasMoreElements())
    {
      String str2 = localStringTokenizer.nextElement().toString();
      if (str1.equals(""))
        str1 = str1 + "  id ='" + str2 + "'";
      else
        str1 = str1 + " or id ='" + str2 + "'";
    }
    String sql = "select id,brand_name,class_id,business_model,brand_desc,brand_area,company_url,substr(add_date,1,10) add_date,logo from brand where " + str1;
    return null;
  }

  public ArrayList getDateParamList(String paramString)
  {
	String sql = "select param_name,param_value from data_parameter where category_code='" + paramString + "'";
    return null;
  }

  public long getMaxid(String paramString1, String paramString2)
  {
    BrandExt localBrandExt = new BrandExt();
    String str1 = paramString1.substring(0, 3);
    String str2 = "";
    if (paramString2.equals("1"))
    {
      str2 = "3";
      str1 = "";
    }
    else if (paramString2.equals("2"))
    {
      str2 = "6";
    }
    else if (paramString2.equals("3"))
    {
      str2 = "10";
    }
    else if (paramString2.equals("4"))
    {
      str2 = "15";
    }
    localBrandExt.setParam(":VUP_ID", str1 + "%");
    localBrandExt.setParam(":VLENGTH", str2);
    List localArrayList = localBrandExt.selByList("SELECT_MAX_ID_BY_CLASS");
    String str3 = "";
    if ((localArrayList != null) && (localArrayList.size() > 0))
    {
      HashMap localHashMap = (HashMap)localArrayList.get(0);
      if (localHashMap.get("maxid") != null)
        str3 = localHashMap.get("maxid").toString();
    }
    long l = Long.valueOf(str3).longValue() + 1L;
    return l;
  }

  public List getClassList(String paramString)
  {
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VUP_ID", paramString + "%");
    List localArrayList = localBrandExt.selByList("SELECT_SON_BY_UP_INCLUDE_SELF");
    return localArrayList;
  }

  public int goToUpClass(String paramString1, String paramString2)
    throws SaasApplicationException
  {
    BrandExt localBrandExt = new BrandExt();
    localBrandExt.setParam(":VUP_ID", paramString1);
    localBrandExt.setParam(":VCLASS_ID", paramString2);
    this.tradeQuery.executeBy(localBrandExt.insBy("MOVE_SALES_CLASS_BY_ID"));
    this.tradeQuery.executeBy(localBrandExt.insBy("UPDATE_SALES_BY_CLASS_ID"));
    return 0;
  }

  public void goToupClass(Buffers paramBuffers)
  {
    this.log.LOG_INFO("进入goToupClass方法...");
    paramBuffers.setClassName("BrandQuery");
    this.outBuffer = paramBuffers;
    this.inBuffer = paramBuffers;
    int i = -1;
    String str1 = paramBuffers.getString("CLASS_ID");
    String str2 = paramBuffers.getString("TYPE");
    try
    {
      StringTokenizer localStringTokenizer1 = new StringTokenizer(str1, "|");
      StringTokenizer localStringTokenizer2 = new StringTokenizer(str1, "|");
      String str3 = "";
      String str4 = "";
      if (localStringTokenizer2.hasMoreTokens())
        str4 = localStringTokenizer2.nextToken();
      long l1 = getMaxid(str4, str2);
      int j = 0;
      CommGetId localcommGetId = new CommGetId();
      while (localStringTokenizer1.hasMoreTokens())
      {
        str3 = localStringTokenizer1.nextToken();
        List localArrayList = getClassList(str3);
        long l2 = l1 + j;
        String str5 = l2 + "";
        for (int k = 0; k < localArrayList.size(); k++)
        {
          HashMap localHashMap = (HashMap)localArrayList.get(k);
          String str6 = "";
          if (localHashMap.get("class_id") != null)
            str6 = localHashMap.get("class_id").toString();
          String str7 = localcommGetId.getGoClassid(str6, str5, str2, str3);
          i = goToUpClass(str6, str7);
        }
        j++;
      }
    }
    catch (SaasApplicationException localSaasApplicationException)
    {
      this.log.LOG_INFO(localSaasApplicationException.getMessage());
    }
    if (i != 0)
    {
      this.outBuffer.setInt("RESULT_CODE", -1);
      this.outBuffer.setString("RESULT_INFO", "业务处理失败！");
    }
    else
    {
      this.outBuffer.setInt("RESULT_CODE", 0);
      this.outBuffer.setString("RESULT_INFO", "业务处理成功！");
    }
    this.log.LOG_INFO("退出goToupClass方法...");
  }

  public List getAdImage(int paramInt1, int paramInt2)
  {
    this.log.LOG_INFO("进入getAdImage方法...");
    if (paramInt1 > 0)
      paramInt1 = (paramInt1 - 1) * paramInt2;
    BrandExt localBrandExt = new BrandExt();
    return localBrandExt.selByList("GET_AD_LIST", paramInt1, paramInt2);
  }

  public int getAdImageCount()
  {
    this.log.LOG_INFO("进入getgetAdImageCount方法...");
    BrandExt localBrandExt = new BrandExt();
    List localArrayList = localBrandExt.selByList("GET_AD_LIST_COUNT");
    if ((localArrayList != null) && (localArrayList.size() > 0))
      return localArrayList.size();
    return 0;
  }
}

